import Vue from 'vue'
import Vuex from 'vuex'
import * as actions from './actions'
import * as getters from './getters'
import mutations from './mutations'

Vue.use(Vuex)

export default new Vuex.Store({
  actions,
  getters,
  mutations,
  state: {
    catid: '',
    catName: '',
    categoryStatus: '', // 当前行业状态
    pageSwitch: -1, // 揭榜页要跳那个页面
    voted: false, // 是否投过票
    shareData: {
      // 分享所需要的信息
      companyName: '', // 品牌的公司名称
      img: '' // 品牌的logo
    },
    serviceInfo: {
      //客服信息
      qq: '',
      tel: '',
      wxqr: '',
      email: ''
    },
    appDownloadLink: window.sessionStorage.getItem('appDownloadLink'), // app下载链接
    wxVoteLink: window.sessionStorage.getItem('wxVoteLink'), // pc端左侧二维码 微信
    wxAppletLink: window.sessionStorage.getItem('wxAppletLink'), // 小程序码
    xcxLink: window.sessionStorage.getItem('xcxLink'), // 纯小程序码
    qrcodeList: window.sessionStorage.getItem('qrcodeList') ? JSON.parse(window.sessionStorage.getItem('qrcodeList')) : [], // 二维码数组
    voteLink: window.sessionStorage.getItem('voteLink'), // pc投票二维码
    guideShareLink: window.sessionStorage.getItem('guideShareLink'), // pc引导分享图
    errorWxQrcode: window.sessionStorage.getItem('errorWxQrcode'), // 错误链接微信二维码
    errorQQ: window.sessionStorage.getItem('errorQQ') // 错误链接QQ
  }
})